//
//  NRDesignateDeptCell.m
//  NetrainFrame
//
//  Created by Gin on 2021/3/9.
//

#import "NRDesignateDeptCell.h"

@interface NRDesignateDeptCell ()

@property (weak, nonatomic) IBOutlet UIButton *choiceButton;
@property (weak, nonatomic) IBOutlet UILabel *groupNameLabel;
@property (weak, nonatomic) IBOutlet UIButton *arrowButton;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *groupNameLeftConstraint;

@end

@implementation NRDesignateDeptCell

- (void)awakeFromNib{
    [super awakeFromNib];
}

- (void)setName:(NSString *)name{
    self.groupNameLabel.text = name;
}

- (void)setChecked:(BOOL)checked{
    _checked = checked;
    self.choiceButton.selected = checked;
}

- (IBAction)selectGroupAction:(id)sender {
    if(_showChoiceButton){
        self.choiceButton.selected = !self.choiceButton.isSelected;
        if(self.choiceBlock){
            self.choiceBlock();
        }
    }
}
@end
